import QtQuick 2.15
import QtQuick.Controls 2.15
import "../component"

ApplicationWindow {
    id: root

    height: background.height
    visible: true
    width: background.width

    Image {
        id: background

        source: '/resources/img/background_medium.png'
    }
    ClickableImage1 {
        id: greenBox

        source: '/resources/img/box_green.png'
        text: 'animation on property'
        x: 40
        y: root.height - height

        NumberAnimation on y {
            duration: 4000
            to: 40
        }
    }
    ClickableImage1 {
        id: blueBox

        source: '/resources/img/box_blue.png'
        text: 'behavior on property'
        x: (root.width - width) /2
        y: root.height - height

        Behavior on y {
            NumberAnimation{duration:4000}
        }
		onClicked: y = 40
    }
    ClickableImage1 {
        id: redBox

        source: '/resources/img/box_red.png'
        x: root.width - width - 40
        y: root.height - height
        text: "standalone animation"
	    onClicked: anim.start()
	    NumberAnimation{
			id : anim
		    target:redBox
		    properties: 'y'
		    to :40
		    duration:4000
	    }
    }
}